package com.emip.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.emip.bean.WeekStoreBean;
import com.emip.dao.WeekStoreDAO;
import com.emip.service.WeekStoreService;



@Service("weekStoreService")
public class WeekStoreServiceImpl implements WeekStoreService {

	@Autowired
	WeekStoreDAO weekStoreDAO;
	
	public List<WeekStoreBean> getByTimespan(int startYear, int startWeekth, 
			int endYear, int endWeekth, String[] itemIds, String siteId) {
		return weekStoreDAO.getByTimespan(startYear, startWeekth, endYear, endWeekth, itemIds, siteId);
	}

	public WeekStoreBean merge(WeekStoreBean store) {
		return weekStoreDAO.merge(store);
	}

	public String getLastDate(String itemId, String siteId) {
		return weekStoreDAO.getLastDate(itemId, siteId);
	}

	public List<WeekStoreBean> getByTimespan(int startYear, int startWeekth,
			int endYear, int endWeekth, String[] itemIds, String siteId,
			int page, int size) {
		return weekStoreDAO.getByTimespan(startYear, startWeekth, endYear, endWeekth, itemIds, siteId, page, size);
	}
	
	public long getCount(int startYear, int startWeekth,
			int endYear, int endWeekth, String[] itemIds, String siteId) {
		return weekStoreDAO.getCount(startYear, startWeekth, endYear, endWeekth, itemIds, siteId);
	}

	public Object[] getStatistics(int startYear, int startWeekth, int endYear,
			int endWeekth, String itemIds, String siteId) {
		return weekStoreDAO.getStatistics(startYear, startWeekth, endYear, endWeekth, itemIds, siteId);
	}
	
	public WeekStoreBean findByWeekth(String year, String weekth, String siteId, String itemId) {
		return weekStoreDAO.findByWeekth(year, weekth, siteId, itemId);
	}

}
